#include "../EncryptionLib/EncryptionLib.h"
#include <iostream>

using namespace std;

#pragma comment(lib, "../Debug/EncryptionLib_d.lib")


int main()
{
	CEncryption encryptionObjServer;
	encryptionObjServer.Init(ENCRYP_AES);

	CEncryption encryptionObjClient;
	encryptionObjClient.Init(ENCRYP_AES);

	char PlainText1[100] = "wen jian Test.cpp hahahhahah wenjian a wenjian weji";
	int PlaintextLen1 = 100;

	char PlainText2[100] = "sfwefwf jfiwojf jwiojfjf  jweijfjf jfiwjfjf ";
	int PlaintextLen2 = 100;

	char CipherText1[100];
	int CipherLen1 = 100;

	char CipherText2[100];
	int CipherLen2 = 100;

	char RecoverText1[100];
	int RecoverTextLen1 = 100;

	char RecoverText2[100];
	int RecoverTextLen2 = 100;

	struct ENCRYPT_INFO encryptInfo;
	encryptionObjServer.GetLocalPublicKey(encryptInfo);
	encryptionObjClient.SetRemoteKeyInfo(encryptInfo);

	encryptionObjClient.GetLocalPublicKey(encryptInfo);
	encryptionObjServer.SetRemoteKeyInfo(encryptInfo);

	encryptionObjServer.Encrypt(CipherText1, CipherLen1, PlainText1, PlaintextLen1);
	encryptionObjServer.Encrypt(CipherText2, CipherLen2, PlainText2, PlaintextLen2);

	char recoverText[100];
	int len;
	encryptionObjClient.Decrypt(RecoverText2, RecoverTextLen2, CipherText2, CipherLen2);

	return 0;
}
